<?php session_start(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/Template.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Untitled Document</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
</head>

<body>
<div id="MainWap">
  <div id="header">
<div class="search"><table width="348" height="45">
        						<tr>
                                	<td width="100px"><font size="+2" >Search</font></td>
                                    <td width="148px"><input type="text" name="txtSearch" /></td>
                                    <td width="100px"><a><img src="image/go.gif" width="50" height="21" border="0" /></a></td>
                                </tr>
        					</table>
        </div>
    </div>
    
    <div id="left">
   	  <div class="left1">
        	<div class="leftMenu titleLeft">Danh mục sản phẩm</div>
         
             <?php
			include "connect.php";
			$sql = "select * from loaisanpham where lcap=0";
			$rs=mysql_query($sql) or die("Loi day du lieu");
			while($r=mysql_fetch_array($rs))
			{
			?>
			<div class="leftnen"><img src="image/button.jpg" width="20" height="20" />&nbsp;&nbsp;<a href="#"><?php echo $r['ltenloaisp'];?></a></div>
			<?php
                }
			?>

      </div>
      <div class="left2">
      	<div class="leftMenu titleLeft"> Đăng nhập</div>
        <?php 
				if ($_SESSION["userlogin"]==false){
				?>
        <form action="login_act.php" method="post" name="f">
        <center style="color:red;"><?php echo $_SESSION["loginerror"];?></center>
        <table width="168px" height="100px" align="center" cellpadding="30">
        <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
        <tr>
        <td>User:</td>
        <td><input type="text" name="txtUser" size="13"/></td>
        </tr>
        <tr>
        <td>Pass:</td>
        <td><input type="password" name="txtPass" size="13"/></td>
        </tr>
        <tr>
        <td align="right"><input type="submit" name="Submit" value="Login"></td>
    <td><input type="reset" name="Submit2" value="Reset"><a href="dangkythanhvien.php" class="linkdangky">Đăng ký</a></td>
        </tr>
        </table>
        </form>
        <?php 
				} else if ($_SESSION["userlogin"]==true) {
					?>
                    <div class="divDSlogin">
                    <?php

					echo "Xin chào: <b>".$_SESSION["username"]."</b>";
					echo "<ul>";
					echo "<li><a href='suathongtincanhan.php'>Sửa thông tin cá nhân</a></li>";
					echo "<li><a href='doipassword.php'>Đổi password</a></li>";
					echo "<li><a href='logout.php'>Đăng xuất</a></li></ul>";
?>
					</div>
<?php
				}
		?>
      </div>
      <div class="left2">
      	<div class="leftMenu titleLeft">Hỗ trợ trực tuyến</div>
        <div align="center">
        <table width="100%">
		<tr>
		<td>
		<td align="left">
        Miss Hang:
        </td>
        <td align="left">
        <a href="ymsgr:sendIM?nguyenthuyhang_nuce"><img border="0" style="" src="http://opi.yahoo.com/online?u=nguyenthuyhang_nuce&amp;m=g&amp;t=1" /></a>

        </td>
        </tr>
        <tr>
        <td>
        <td align="left">
		Mr Huy:
        </td>
        <td align="left">
        <a href="ymsgr:sendIM?huy_xda_pm1"><img border="0" style="" src="http://opi.yahoo.com/online?u=huy_xda_pm1&amp;m=g&amp;t=1" /></a>

        </td>
        </tr>
        <tr>
        <td>
        <td align="left">
		Mr Dat:
        </td>
        <td align="left">
        <a href="ymsgr:sendIM?nhung_ng4yx4nh2007"><img border="0" style="" src="http://opi.yahoo.com/online?u=nhung_ng4yx4nh2007&amp;m=g&amp;t=1" /></a>

        </td>
        </tr>
        </table>   
        </div>     
      </div>
  </div>
  
    <div id="TopMenu">
     <table border="0" width="785px" height="30px">
     	<tr>
        	<td class="tdtopmenu textTopmenu td"><a href="index.php">Trang chủ</a></td>
            <td class="tdtopmenu textTopmenu td"><a href="#">Sản phẩm</a></td>
            <td class="tdtopmenu textTopmenu td"><a href="tintuc.php">Tin tức</a></td>
            <td class="tdtopmenu textTopmenu td"><a href="tuvan.php">Tư vấn</a></td>
            <td class="tdtopmenu textTopmenu td"><a href="gioithieu.php">Giới thiệu</a></td>
            <td class="textTopmenu td"><a href="Lienhe.php">Liên hệ</a></td>
        </tr>
     </table>
    </div>
    
    <div id="conten">
  <!-- InstanceBeginEditable name="vung sua dc 1" -->
 <div class="conten1 textConten">Đổi password</div>
 <div>
 <form action="xuly_doipassword.php" method="post" onsubmit="return check();" name="f2" id="f2">
 <table width="300" border="0" height="200px">
 <tr>
 	<td>&nbsp;</td>
    <td>&nbsp;</td>
 </tr>
  <tr>
    <td>Nhập mật khẩu cũ:</td>
    <td><input type="password" name="txtmkcu" /></td>
  </tr>
  <tr>
    <td>Nhập mật khẩu mới:</td>
    <td><input type="password" name="txtmkmoi" /></td>
  </tr>
  <tr>
    <td>Nhập lại mật khẩu mới:</td>
    <td><input type="password" name="txtmkmoiconfirm" /></td>
  </tr>
  <tr>
    <td align="center"><input type="submit" name="submit" value="Đổi password" /></td>
    <td><input type="reset" name="reset" value="Hủy tất cả" /></td>
  </tr>
</table>

 </form>
 <script>
 	function check(){
		with(document){
			if(f2.txtmkcu.value==""){
				alert("Mật khẩu cũ không được để trống");
				f2.txtmkcu.focus();
				return false;
				}
			}
		with(document){
			if(f2.txtmkmoi.value==""){
				alert("Mật khẩu mới không được để trống");
				f2.txtmkmoi.focus();
				return false;
				}
			}
		with(document){
			if(f2.txtmkmoiconfirm.value==""){
				alert("Mật khẩu nhập lại không được để trống");
				f2.txtmkmoiconfirm.focus();
				return false;
				}
			}
		//kiem tra xem password đã tồn tại chưa?
		//kiểm tra mk mới và nhập lại phải giống nhau
		//with(document){
			//if(f2.txtmkmoi.value!=f2.txtmkmoiconfirm.value){
				
			//	}
			//	alert("Ban cần nhập lại mật khẩu như trên");
			//	f2.txtmkmoiconfirm.focus();
			//	return false;
			//}
		}
 </script>
 </div>
  <!-- InstanceEndEditable --></div>
    
  <div class="clr"></div>
   
   <div id="footter"></div>
</div>
</body>
<!-- InstanceEnd --></html>
